import sqlite3

def main():
    try:
        with sqlite3.connect('ai_proj.db') as conn:
            cursor = conn.cursor()

            countSql = "SELECT COUNT(*) FROM api_call_log"
            count = cursor.execute(countSql).fetchone()[0]

            if count == 0:
                print("No records found.")
            else:
                print("Total number of records:", count)
    except sqlite3.Error as e:
        print("Error connecting to the database:", e)
        return

if __name__ == "__main__":
    main()

